home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Development Tools / Unsupported Tools / AE Coercion / InstallCoercions.a < prev    next >
Encoding:
Text File  |  1992-02-19  |  2.3 KB  |  66 lines  |  [TEXT/MPS ]

  1. ;------------------------------------------------------------------------------
  2. ;
  3. ;    Apple Macintosh Developer Technical Support
  4. ;
  5. ;    Sample AppleEventâ„¢ Coercion Handler Installing INIT
  6. ;    File:        InstallCoercions.a - Asm source
  7. ;    By: C.K. Haun <TR>
  8. ;    Copyright Â© 1991 Apple Computer, Inc.
  9. ;    All rights reserved.
  10. ;
  11. ;------------------------------------------------------------------------------
  12. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  13. ;
  14. ;
  15. ;    Generic install routine. This is the code that gets executed when INIT 31
  16. ;    calls our INIT. The first thing we do is check to see if any of the scare
  17. ;    buttons are being pressed. If the user is holding the mouse button, 
  18. ;    then don't install, and show the unhappy icon. 
  19. ;    If the shift key is down, System 7 has already disallowed extensions,
  20. ;    so we don't need to double-check (since we're 7.0 only)
  21. ;    The we jump to the C routines that do the actual work.
  22. ;
  23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  24.  
  25.  
  26.  
  27.                 include 'ToolEqu.a'
  28.                 include 'SysEqu.a'
  29.                 include 'QuickEqu.a'
  30.                 include 'Traps.a'
  31.  
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. ;
  34. ;    These are the IDs for the icons used by ShowINIT. ShowINIT is a really
  35. ;    cool hack by Paul Mercer that displays those icons across the bottom of
  36. ;    your screen when you boot up. You can choose what icon to show up, based
  37. ;    on how the installation went. If the installation went OK, we show the
  38. ;    INIT's icon.  If the installation didn't work, we
  39. ;    show a version of the icon with an X through it. 
  40. ;
  41. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  42.  
  43. IconID            EQU        128
  44. BadIconID        EQU        129
  45.  
  46. INITInstall        PROC    EXPORT
  47.                 IMPORT    SHOWINIT
  48.                 IMPORT    cInstall:CODE
  49.                 tst.b    MBState                    ; don't install if mouse button is down
  50.                 bpl.s    NoInstall                ;
  51.                 bsr cInstall                    ; call cInstall to install the handlers
  52.                 tst.w    D0                        ; any errors?
  53.                 bne.s    NoInstall            ; yes, show bad icon
  54. ExitInit
  55.                 move.w    #IconID,-(sp)            ; ICN# ID of happy icon
  56.                 bra.s    ShowTheIcon                ;
  57. NoInstall
  58.                 move.w    #BadIconID,-(sp)        ; ICN# ID of unhappy icon
  59. ShowTheIcon
  60.                 move.w    #-1,-(sp)                ; use default moveX
  61.                 bsr        SHOWINIT                ; draw the icon
  62.                 rts                                ; return to INIT 31
  63.                 ENDP
  64.                 END
  65.  
  66.